package com.dianping.cat.home.service.client.entity;

import com.dianping.cat.home.service.client.BaseEntity;
import com.dianping.cat.home.service.client.IVisitor;
import java.util.LinkedHashMap;
import java.util.Map;









public class Domain
  extends BaseEntity<Domain>
{
  private String m_id;
  private long m_totalCount;
  private long m_failureCount;
  private double m_failurePercent;
  private double m_sum;
  private double m_avg;
  private Map<String, Method> m_methods = new LinkedHashMap();





  public Domain(String id) { this.m_id = id; }




  public void accept(IVisitor visitor) { visitor.visitDomain(this); }


  public Domain addMethod(Method method) {
/*  40 */     this.m_methods.put(method.getId(), method);
/*  41 */     return this;
  }


  public boolean equals(Object obj) {
/*  46 */     if (obj instanceof Domain) {
/*  47 */       Domain _o = (Domain)obj;

/*  49 */       if (!equals(getId(), _o.getId())) {
/*  50 */         return false;
      }

/*  53 */       return true;
    }

/*  56 */     return false;
  }


/*  60 */   public Method findMethod(String id) { return (Method)this.m_methods.get(id); }


  public Method findOrCreateMethod(String id) {
/*  64 */     Method method = (Method)this.m_methods.get(id);

/*  66 */     if (method == null) {
/*  67 */       synchronized (this.m_methods) {
/*  68 */         method = (Method)this.m_methods.get(id);

/*  70 */         if (method == null) {
/*  71 */           method = new Method(id);
/*  72 */           this.m_methods.put(id, method);
        }
      }
    }

/*  77 */     return method;
  }


/*  81 */   public double getAvg() { return this.m_avg; }



/*  85 */   public long getFailureCount() { return this.m_failureCount; }



/*  89 */   public double getFailurePercent() { return this.m_failurePercent; }



/*  93 */   public String getId() { return this.m_id; }



/*  97 */   public Map<String, Method> getMethods() { return this.m_methods; }



/* 101 */   public double getSum() { return this.m_sum; }



/* 105 */   public long getTotalCount() { return this.m_totalCount; }



  public int hashCode() {
/* 110 */     int hash = 0;

/* 112 */     return hash * 31 + ((this.m_id == null) ? 0 : this.m_id.hashCode());
  }



  public Domain incFailureCount() {
/* 118 */     this.m_failureCount++;
/* 119 */     return this;
  }

  public Domain incFailureCount(long failureCount) {
/* 123 */     this.m_failureCount += failureCount;
/* 124 */     return this;
  }

  public Domain incSum() {
/* 128 */     this.m_sum++;
/* 129 */     return this;
  }

  public Domain incSum(double sum) {
/* 133 */     this.m_sum += sum;
/* 134 */     return this;
  }

  public Domain incTotalCount() {
/* 138 */     this.m_totalCount++;
/* 139 */     return this;
  }

  public Domain incTotalCount(long totalCount) {
/* 143 */     this.m_totalCount += totalCount;
/* 144 */     return this;
  }


  public void mergeAttributes(Domain other) {
/* 149 */     assertAttributeEquals(other, "domain", "id", this.m_id, other.getId());

/* 151 */     this.m_totalCount = other.getTotalCount();

/* 153 */     this.m_failureCount = other.getFailureCount();

/* 155 */     this.m_failurePercent = other.getFailurePercent();

/* 157 */     this.m_sum = other.getSum();

/* 159 */     this.m_avg = other.getAvg();
  }


/* 163 */   public Method removeMethod(String id) { return (Method)this.m_methods.remove(id); }


  public Domain setAvg(double avg) {
/* 167 */     this.m_avg = avg;
/* 168 */     return this;
  }

  public Domain setFailureCount(long failureCount) {
/* 172 */     this.m_failureCount = failureCount;
/* 173 */     return this;
  }

  public Domain setFailurePercent(double failurePercent) {
/* 177 */     this.m_failurePercent = failurePercent;
/* 178 */     return this;
  }

  public Domain setId(String id) {
/* 182 */     this.m_id = id;
/* 183 */     return this;
  }

  public Domain setSum(double sum) {
/* 187 */     this.m_sum = sum;
/* 188 */     return this;
  }

  public Domain setTotalCount(long totalCount) {
/* 192 */     this.m_totalCount = totalCount;
/* 193 */     return this;
  }

  public Domain() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/classes/!/com/dianping/cat/home/service/client/entity/Domain.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */